//
//  KZCategoryEventCell.m
//  xiaorizi
//
//  Created by kun on 15/10/27.
//  Copyright © 2015年 origin. All rights reserved.
//

#import "KZCategoryEventCell.h"
#import "UIImageView+WebCache.h"


@interface KZCategoryEventCell ()
@property (weak, nonatomic) IBOutlet UIImageView *eventsImgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;

@end

@implementation KZCategoryEventCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(void)setModel:(CategorySubEventModel *)model
{
    _model = model;

    _titleLabel.text = model.title;
    _addressLabel.text = model.address;
    [_eventsImgView sd_setImageWithURL:[NSURL URLWithString:model.imgs]];
    
    _eventsImgView.userInteractionEnabled = YES;
    //图片添加点击手势
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imgClicked:)];
    [_eventsImgView addGestureRecognizer:tap];
}

-(void)imgClicked:(UITapGestureRecognizer *)tap
{
    if(self.clickedImgToDetailView)
    {
        self.clickedImgToDetailView(self,_model);
    }
}


@end
